#pragma once

#include "IAcceptor.h"
#include "IReactor.h"
#include "IEventHandler.h"
#include "ServiceHandler.h"
#include "INET_Addr.h"
#include "SOCK_Acceptor.h"
#include "SOCK_Stream.h"
#include "ServiceHandler.h"
#include "PatientValueEventServer.h"
#include "IInfo.h"
#include <winsock.h>

#define NUMBER_OF_SERVICE_HANDLERS 50

class ConcreteAcceptor :
	public IAcceptor<SOCKET>
{
public:
	ConcreteAcceptor(IReactor<SOCKET>* reactor, INET_Addr&, IInfo*);
	~ConcreteAcceptor(void);

protected:
	ServiceHandler<SOCKET>* makeServiceHandler();
	void acceptServiceHandler(ServiceHandler<SOCKET>*);

private:
	SOCK_Stream stream;
	SOCK_Acceptor acceptor;
	ServiceHandler<SOCKET>* serviceHandlers[NUMBER_OF_SERVICE_HANDLERS];
	IInfo* info;

};

